//
//  define.h
//  giuseppe
//
//  Created by Apple on 15/7/14.
//  Copyright (c) 2015年 GiantUmbrella. All rights reserved.
//

#ifndef giuseppe_define_h
#define giuseppe_define_h

#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kScreenHeight [UIScreen mainScreen].bounds.size.height

#define ScreenW [UIScreen mainScreen].bounds.size.width
#define ScreenH [UIScreen mainScreen].bounds.size.height

#define kScrollW _scrollView.frame.size.width
#define kScrollH _scrollView.frame.size.height

#define UIColorWithRGBA(r,g,b,a)        [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]


#ifdef DEBUG
#define RXDLog(...) NSLog(__VA_ARGS__)
#else
#define RXDLog(...)
#endif

//#define MRAPI @"http://mrbang.ketao.com/api/"

#define MRAPI @"http://www.mrbang.com.cn/api/"

#define MJDuration 2.0


#define ISLOGIN [[[NSUserDefaults standardUserDefaults]objectForKey:@"loginfrom"] intValue]

/**
 *  RGB颜色
 */
#define RXDColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]

/**
 *  随机色
 */
#define RXDRandomColor RXDColor(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256))


/**
 *比例关系 宽
 */
#define  PROPORTION_WIDTH [UIScreen mainScreen].bounds.size.width/720
/**
 *比例关系 高
 */
#define  PROPORTION_HEIGHT [UIScreen mainScreen].bounds.size.height/1435

//宽
#define DesignW  720

#define DesignH  1435

#define COLOR_TEXT_0  RXDColor(0, 0, 0) //文字颜色 黑色

#define COLOR_TEXT_ORANGE  RXDColor(232, 72, 46) //文字颜色 橘黄色

#define COLOR_TEXT_132  RXDColor(132, 132, 132) //文字颜色 灰色

#define COLOT_TEXTGRAY  RXDColor(102, 102, 102) //文字颜色 灰色

#define COLOR_BUTTON  RXDColor(255, 118, 112)//各个按钮颜色

#define COLOR_UNBUTTON RXDColor(192, 201, 205)//为选中 时候按钮颜色

/**
 *字体大小
 */
#define Font_SIZE_14 14

/**
 *字体大小
 */
#define Font_SIZE_18 18*PROPORTION_WIDTH

/**
 *字体大小
 */
#define Font_SIZE_24 24*PROPORTION_WIDTH

/**
 *字体大小
 */
#define Font_SIZE_22 22*PROPORTION_WIDTH


/**
 *字体大小
 */
#define Font_SIZE_30 30*PROPORTION_WIDTH

/**
*背景色
*/
#define COLOR_BACKGROUND  #eeeff1


/**
 * 每个页面背景的颜色
 */
#define COLOR_EVERYVIEWBG  RXDColor(238, 239, 241)

#define LEFT_SPACING 15//距离左侧的间距


#define IS_OS_5_OR_LATER                            SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"5.0")
#define IS_OS_6_OR_LATER                            SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"6.0")
#define IS_OS_7_OR_LATER                            SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")

#define IS_WIDESCREEN_5                            (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double)568) < __DBL_EPSILON__)
#define IS_WIDESCREEN_6                            (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double)667) < __DBL_EPSILON__)
#define IS_WIDESCREEN_6Plus                        (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double)736) < __DBL_EPSILON__)
#define IS_IPHONE                                  ([[[UIDevice currentDevice] model] isEqualToString: @"iPhone"] || [[[UIDevice currentDevice] model] isEqualToString: @"iPhone Simulator"])
#define IS_IPOD                                    ([[[UIDevice currentDevice] model] isEqualToString: @"iPod touch"])
#define SCREEN_WIDTH ([[UIScreen mainScreen] bounds].size.width)
#define SCREEN_HEIGHT ([[UIScreen mainScreen] bounds].size.height)
#define SCREEN_MAX_LENGTH (MAX(SCREEN_WIDTH, SCREEN_HEIGHT))
#define SCREEN_MIN_LENGTH (MIN(SCREEN_WIDTH, SCREEN_HEIGHT))

#define IS_IPHONE_4_OR_LESS (IS_IPHONE && SCREEN_MAX_LENGTH < 568.0)
#define IS_IPHONE_5 (IS_IPHONE && SCREEN_MAX_LENGTH == 568.0)
#define IS_IPHONE_6 (IS_IPHONE && SCREEN_MAX_LENGTH == 667.0)
#define IS_IPHONE_6P (IS_IPHONE && SCREEN_MAX_LENGTH == 736.0)


#endif
